<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="author" content="wangbo">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    文本框中输入：<input type="text" id="t1" value="" onblur="upperCase(this)" />
    失去焦点后的： <input type="text" id="t2" value="" />
    <script type="text/javascript">
        function upperCase() {
            document.getElementById("t2").value = document.getElementById("t1").value.toUpperCase()
        }
    </script>
</body>

</html>